package com.example.pingze.service;

import com.example.pingze.entity.BannerPicture;
import com.example.pingze.repository.BannerRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

@Service
public class BannerService {
    @Autowired
    private BannerRepository repository;

    public Page getBannerInfo(Pageable pageable) {
        Page page = repository.findAll(pageable);
        return page;
    }

    public BannerPicture saveBanner(BannerPicture banner) {
        BannerPicture save = repository.save(banner);
        return save;
    }
}
